<template>
	<view>
		<uni-load-more v-if="list.length === 0 && !articleShow" iconType="snow" status="loading"></uni-load-more>
		<list-card mode="base" :item="item" v-for="item in list" :key="item._id"></list-card>
		<view class="no-data" v-if="articleShow">
			没有发表过文章
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				articleShow: false
			};
		},
		onLoad() {
			this.getMyArticle()
		},
		methods: {
			getMyArticle() {
				this.$api.get_my_article().then(res => {
					const { data } = res
					this.list = data
					if(this.list.length === 0) {
						this.articleShow = true
					}
					console.log(res);
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
